import http from "@/http";
//学生数据类型
export type Student = {
    stuId: string;
    classId: string;
    stuName: string;
    sex: string;
    phone: string;
    stuNum: string;
    password: string;
    status: string;
}
//分页参数
export type PageParm = {
    currentPage:number;
    pageSize:number;
    stuName:string;
    phone:string;
    classId:string;
    stuNum:string;
}

//新增学生
export const addApi = (parm: Student) => {
    return http.post("/api/student", parm)
}
//学生列表
export const getListApi = (parm:PageParm)=>{
    return http.get("/api/student/list",parm)
}
//编辑学生
export const editApi = (parm: Student) => {
    return http.put("/api/student", parm)
}
//删除学生
export const deleteApi = (stuId: string) => {
    return http.delete(`/api/student/${stuId}`)
}
//重置密码
export const resetPasswordApi = (stuId: string) => {
    return http.post("/api/student/resetPassword", {stuId:stuId})
}